
var _util = require("util/util.js");

var chat = {
	//获取未读消息数量
	getMessageCount : function(resolve,reject){
		_util.request({
            url     : _util.getServerUrl('/chat/query_no_read_count.do'),
            method  : 'post',
            success : resolve,
            error   : reject
        });
	},
	//获取聊天用户
	getChatUser : function(resolve,reject){
		_util.request({
            url     : _util.getServerUrl('/chat/query_chat_user.do'),
            method  : 'post',
            success : resolve,
            error   : reject
        });
	},
	//获取聊天内容
	getChatList : function(data,resolve,reject){
		_util.request({
            url     : _util.getServerUrl('/chat/list.do'),
            method  : 'post',
            data 	: data,
            success : resolve,
            error   : reject
        });
	},
	send : function(data,resolve,reject){
		_util.request({
            url     : _util.getServerUrl('/chat/send.do'),
            method  : 'post',
            data 	: data,
            success : resolve,
            error   : reject
        });
	}
}

module.exports = chat;